package com.dream.keigezhushou.Activity.pop;

import android.content.Context;
import android.view.View;
import android.widget.Button;

import com.dream.keigezhushou.R;

/**
 * Created by Administrator on 2017/3/21.
 * 完成弹出框
 */
public class FinishSaveWindow extends DialogBase {

    private Context context;
    private ItemClickListener itemClickListener;


    private Button makeSureBtn, cancelBtn;

    /**
     * @param contentView
     * @param context
     * @param width
     * @param height      设置高度
     */
    public FinishSaveWindow(final View contentView, final Context context, int width, int height) {
        super(contentView, context, width, height);
        this.context = context;

        makeSureBtn = (Button) contentView.findViewById(R.id.pop_window_makesure);
        cancelBtn =(Button) contentView.findViewById(R.id.pop_window_cancel);


        makeSureBtn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {

                if (itemClickListener!=null){

                    dismiss();
                    itemClickListener.onMakeSure();

                }


            }
        });


        cancelBtn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {

                dismiss();

            }
        });

    }


    public void setItemListener(ItemClickListener itemClickListener) {

        this.itemClickListener = itemClickListener;
    }


    public interface ItemClickListener {

        public void onMakeSure();

    }


}
